package com.example.sparksubmitter.dto;

import javax.validation.constraints.NotBlank;
import java.util.HashMap;
import java.util.Map;

public class SparkSqlRequest {

    @NotBlank(message = "SQL 语句不能为空")
    private String sqlText;

    @NotBlank(message = "Master URL 不能为空")
    private String masterUrl = "yarn";

    private String deployMode = "client";

    private String sparkHome = "D:\\spark-3.2.3-bin-hadoop3.2";

    private String hadoopConfDir = "D:\\hadoop_conf";

    private String executorMemory = "2g";

    private String driverMemory = "1g";

    private int numExecutors = 2;

    private int executorCores = 2;

    private Map<String, String> additionalConf = new HashMap<>();

    // 构造函数、Getter 和 Setter 方法
    public SparkSqlRequest() {}

    public String getSqlText() {
        return sqlText;
    }

    public void setSqlText(String sqlText) {
        this.sqlText = sqlText;
    }

    public String getMasterUrl() {
        return masterUrl;
    }

    public void setMasterUrl(String masterUrl) {
        this.masterUrl = masterUrl;
    }

    public String getDeployMode() {
        return deployMode;
    }

    public void setDeployMode(String deployMode) {
        this.deployMode = deployMode;
    }

    public String getSparkHome() {
        return sparkHome;
    }

    public void setSparkHome(String sparkHome) {
        this.sparkHome = sparkHome;
    }

    public String getHadoopConfDir() {
        return hadoopConfDir;
    }

    public void setHadoopConfDir(String hadoopConfDir) {
        this.hadoopConfDir = hadoopConfDir;
    }

    public String getExecutorMemory() {
        return executorMemory;
    }

    public void setExecutorMemory(String executorMemory) {
        this.executorMemory = executorMemory;
    }

    public String getDriverMemory() {
        return driverMemory;
    }

    public void setDriverMemory(String driverMemory) {
        this.driverMemory = driverMemory;
    }

    public int getNumExecutors() {
        return numExecutors;
    }

    public void setNumExecutors(int numExecutors) {
        this.numExecutors = numExecutors;
    }

    public int getExecutorCores() {
        return executorCores;
    }

    public void setExecutorCores(int executorCores) {
        this.executorCores = executorCores;
    }

    public Map<String, String> getAdditionalConf() {
        return additionalConf;
    }

    public void setAdditionalConf(Map<String, String> additionalConf) {
        this.additionalConf = additionalConf;
    }
}    